<template>
	<view class="detail">
		<view class="bj">
			<view class="title">{{ detail?.title }}</view>
			<mp-html :content="detail?.content" />
		</view>
	</view>
</template>

<script setup>
	import { ref, onMounted } from 'vue'
	import home from '@/api/home.js'
	onMounted(() => {
		let pages = getCurrentPages()
		let curParams = pages[pages.length-1].options
		articleInfoFn(curParams.id)
	})
	const detail = ref()
	const articleInfoFn = async (id) => {
		const { status, info, data } = await home.articleInfo({id: id})
		if(status == 1) {
			console.log(data);
			detail.value = data
		}
	}
</script>

<style lang="scss" scoped>
	.detail {
		padding: 26rpx;
		.bj {
			background: #fff;
			border-radius: 32rpx;
			box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(128,128,128,0.06);
			padding: 30rpx;
			.title {
				font-family: PingFang SC, PingFang SC;
				font-weight: 600;
				font-size: 32rpx;
				color: #000000;
				line-height: 38rpx;
				text-align: center;
				margin-bottom: 30rpx;
			}
		}
	}
</style>